Image correction method of projector and image correction system

ABSTRACT

An image correction method of projector and an image correction system are provided. An image capturing apparatus shoots a physical calibration panel to obtain a first image, and shoots an outputting image of a calibration panel pattern on a projection screen outputted from the projector to obtain a second image. A processor analyzes the first image to obtain a first calibration parameter and a first homography matrix, and performs an undistorting operation for the second image based on the first calibration parameter to obtain a third image. The processor analyzes the third image to obtain a second calibration parameter and a second homography matrix of the projector. The processor performs a compensating operation for an original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix to obtain a compensated image.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial no. 105126843, filed on Aug. 23, 2016. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The invention relates to an image processing method and a system thereof, and more particularly, to an image correction method of projector and an image correction system.

2. Description of Related Art

Generally, a lighting source is provided inside a projector to project images onto a physical plane through an optical lens set for viewing. The projector also plays an important role as a key element in a structure light three dimension (3D) scanner and a photocuring 3D printer. However, a projection picture outputted from the projector may show deformations due to internal design of the optical lens set disposed.

There are two major factors causing the deformations on the picture. One of the factors can easily lead to a distortion caused by light refracted onto a projective plane. The other factor can lead to a keystone effect, which is caused by an optical axis not perpendicular to the projective plane or a skew offset generated by installment of the optical lens set. As an example of the distortion, in the case where an image originally transmitted to the projector is a square, a square exterior should be outputted under ideal projection conditions. Nonetheless, owing to the optical lens set being disposed, most of the projectors will show the distortion, commonly including a barrel distortion and a pincushion distortion. This type of distortion needs to be described with use of a non-linear equation. On the other hand, the keystone effect may be simply expressed by using a linear deformation approach.

SUMMARY OF THE INVENTION

The invention is directed to an image correction of projector and an image correction system, which are capable of synchronously correcting the linear keystone effect and the non-linear distortion of projector.

The image correction method of projector according to the invention includes: shooting a physical calibration panel by an image capturing apparatus to obtain a first image, wherein the physical calibration panel is arranged on a location where a projection screen of a projector is located; analyzing the first image by using a processor to obtain a first calibration parameter and a first homography matrix of the image capturing apparatus; shooting an outputting image of a calibration panel pattern on the projection screen outputted from the projector by the image capturing apparatus to obtain a second image; performing an undistorting operation for the second image based on the first calibration parameter by using the processor to obtain a third image; analyzing the third image by using the processor to obtain a second calibration parameter and a second homography matrix of the projector; and performing a compensating operation for an original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix by the processor to obtain a compensated image, so as to output the compensated image on the projection screen from the projector.

In an embodiment of the invention, the first calibration parameter includes a first internal parameter and a first distortion parameter. The step of analyzing the first image by using the processor to obtain the first calibration parameter and the first homography matrix of the image capturing apparatus includes: setting the first internal parameter based on a resolution of the first image; calculating the first distortion parameter based on the first internal parameter; performing the undistorting operation based on the first distortion parameter to obtain a first undistorted image; and calculating the first homography matrix according to the first undistorted image and a coordinate matrix corresponding to the physical calibration panel.

In an embodiment of the invention, the second calibration parameter includes a second internal parameter and a second distortion parameter. The step of analyzing the third image by using the processor to obtain the second calibration parameter and the second homography matrix of the projector includes: setting the second internal parameter based on a resolution of the third image; calculating the second distortion parameter based on the second internal parameter; performing the undistorting operation based on the first distortion parameter to obtain a first undistorted image; and calculating the second homography matrix according to the second undistorted image and a coordinate matrix corresponding to the calibration panel pattern.

In an embodiment of the invention, the step of performing the compensating operation for the original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix by the processor to obtain the compensated image includes: performing an inverse homography transformation operation for the original image by using the second homography matrix to obtain a first corrected image; performing the undistorting operation for the first corrected image by using the second calibration parameter to obtain a second corrected image; performing a homography transformation operation for the second corrected image by using the second homography matrix to obtain a third corrected image; and performing the homography transformation operation for the third corrected image by using the first homography matrix to obtain the compensated image.

In an embodiment of the invention, the image capturing apparatus and the projector are located on the same side of the projection screen, or the image capturing apparatus and the projector are located on different sides of the projection screen.

The image correction system of the invention includes: a projector; an image capturing apparatus, shooting a physical calibration panel arranged on a location where a projection screen of a projector is located to obtain a first image, and shooting an outputting image of a calibration panel pattern on the projection screen outputted from the projector to obtain a second image; and a processor, coupled to the image capturing apparatus and the projector. The processor analyzes the first image to obtain a first calibration parameter and a first homography matrix of the image capturing apparatus; the processor performs an undistorting operation for the second image based on the first calibration parameter to obtain a third image; the processor analyzes the third image to obtain a second calibration parameter and a second homography matrix of the projector; the processor performs a compensating operation for an original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix to obtain a compensated image, so as to output the compensated image on the projection screen from the projector.

Based on the above, by shooting the physical calibration panel and the outputting image on the projection screen through the additionally disposed image capturing apparatus to obtain the two images, the linear deformation mode and the non-linear deformation mode in the projector may be calculated and used to perform the compensating operation for the original image expected to be projected. Accordingly, the compensated image that is already added with undistorted factors may present the picture with the same proportion as the original image after being outputted from the projector. As a result, the issue of the deformations on the output picture of the projector may be solved while achieving the effectiveness of accurate positioning.

To make the above features and advantages of the invention more comprehensible, several embodiments accompanied with drawings are described in detail as follows.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

FIG. 1 is a block diagram of an image correction system according to an embodiment of the invention.

FIG. 2A and FIG. 2B are schematic diagrams illustrating configurations of the image correction system according to an embodiment of the invention.

FIG. 3 is a flowchart of an image correction method of processor according to an embodiment of the invention.

FIG. 4 is a flowchart of an image analysis method according to the invention.

DESCRIPTION OF THE EMBODIMENTS

Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.

FIG. 1 is a block diagram of an image correction system according to an embodiment of the invention. Referring to FIG. 1, an image correction system 100 includes an image capturing apparatus 110, a projector 120 and a processor 130. Here, the processor 130 is connected to each of the image capturing apparatus 110 and the projector 120 by ways of wired connection or wireless connection. That is to say, the image capturing apparatus 110 and the projector 120 are communicated with the processor 130 by ways of wired connection or wireless connection so the processor 130 is able to receive data from the image capturing apparatus 110 and transmit the data to the projector 120.

The image capturing apparatus 110 is, for example, a camcorder or camera using a charge coupled device (CCD) lens or a complementary metal oxide semiconductor transistor (CMOS).

The projector 120 is, for example, a video projector including a cathode ray tube (CRT) projector, a liquid-crystal display (LCD) projector, a digital light processing (DLP) projector, a liquid crystal on silicon (LCoS) projector, and a light-emitting diode (LED) projector. However, the invention is not limited to the above, and any device with suitable specification may be adopted in consideration of different resolutions and different brightness contrasts.

The processor 130 is, for example, a central processing unit (CPU), a graphic processing unit (GPU), a physics processing unit (PPU), a microprocessor, an embedded control chip, a digital signal processor (DSP), an application specific integrated circuits (ASIC) or other similar devices.

In the image correction system 100, the image capturing apparatus 110 is used to take two images. One of the images is obtained by shooting a physical calibration panel arranged on a location where a projection screen is located, and the other image is obtained by shooting an outputting image of a calibration panel pattern on projection screen outputted from the projector 120. The processor 130 can calculate a linear deformation mode and a non-linear deformation mode in the projector 120 according to the two images and further inversely correct an original image expected to be projected based on the linear deformation mode and the non-linear deformation mode so a projected picture can maintain the same proportion as the original image expected to be projected. Here, a pattern on the physical calibration panel and the calibration panel pattern is, for example, a regular grid pattern, but the invention is not limited thereto.

In the present embodiment, the processor 130 is, for example, disposed in another independent electronic device. Further, the image capturing apparatus 110 and the projector 120 are located on the same side of the projection screen, or the image capturing apparatus 110 and the projector 120 are located on different sides of the projection screen.

For instance, FIG. 2A and FIG. 2B are schematic diagrams illustrating configurations of the image correction system according to an embodiment of the invention. FIG. 2A shows that the image capturing apparatus 110 and the projector 120 are located on different sides of a projection screen 140. FIG. 2B shows that the image capturing apparatus 110 and the projector 120 are located on the same side of the projection screen 140.

Furthermore, in other embodiments, the processor 130 may be built-in inside the projector 120; or the processor 130 may be disposed inside the image capturing apparatus 110. In other embodiments, the image capturing apparatus 110, the processor 130 and the projector 120 may be integrated into one device, such as a personal computer, a notebook computer, a smart phone and a tablet computer each having photo-taking, video-taking and projecting capabilities, but the invention is not limited to the above.

Each step in the image correction method of projector will be described below with reference to the image correction system 100. FIG. 3 is a flowchart of an image correction method of processor according to an embodiment of the invention.

Referring to FIG. 1 to FIG. 3 together, in step S305, a physical calibration panel is shot by the image capturing apparatus 110 to obtain a first image. Here, the physical calibration panel is arranged on a location where the projection screen 140 of the projector 120 is located. For example, at one side of the projection screen 140 provided as a shooting target for the image capturing apparatus 110, a calibration thin plate (the physical calibration panel) may be placed for the image capturing apparatus 110 to shoot. After the first image is obtained through shooting, the image capturing apparatus 110 transmits the first image to the processor 130 so the subsequent image analysis process may be proceeded (i.e., step S310 is performed).

In step S310, the processor 130 analyzes the first image to obtain a first calibration parameter and a first homography matrix of the image capturing apparatus 110. For example, the first calibration parameter includes a first internal parameter and a first distortion parameter. After the first internal parameter and the first distortion parameter are obtained from the first image, an undistorting operation is performed based on the first distortion parameter to obtain a first undistorted image. Also, the processor 130 calculates a first homography matrix according to the first undistorted image and a coordinate matrix corresponding to the physical calibration panel. The homography matrix includes a combination of matrices regarding rotation, transition, scaling, affine and perspective projection of the image. The first homography matrix underwent matrix decomposition may be used to correct the keystone effect of the first image.

The keystone effect is a common distortion in cameras or projectors. In less serious cases, the keystone effect may be corrected by using a linear interpolation. Yet, the linear interpolation is unable to conduct a correction on offsets generated in depth. Therefore, a perspective projection (i.e., a homography correction) is used in the present embodiment to conduct the correction.

The distortion parameters (the first distortion parameter and a second distortion parameter (which will be described later)) are usually represented a polynomial and used to describe the barrel distortion or pincushion distortion caused by lenses. In other words, after the undistorting operation is perfoinied by the processor 130 for an image under test by using the distortion parameter, the generated undistorted image can be used to correct the image back to a mathematical model similar to that of a pinhole projection.

Further, in step S315, an outputting image of a calibration panel pattern on the projection screen 140 outputted from the projector 120 is shot by the image capturing apparatus 110 to obtain a second image. Here, a semi-transparent material (e.g., a very thin paper) on which projection may be formed may be disposed to serve as the projection screen 140. After the second image is obtained through shooting, the image capturing apparatus 110 transmits the second image to the processor 130 for the subsequent analysis.

Then, in step S320, the processor 130 performs the undistorting operation for the second image based on the first calibration parameter to obtain a third image. That is to say, the factor leading to the distortion caused by the image capturing apparatus 110 is eliminated from the second image to obtain the third image. Then, the processor 130 performs the subsequent image analysis process for the third image (i.e., step S325 is performed).

In step S325, the processor 130 analyzes the third image to obtain a second calibration parameter and a second homography matrix of the projector 120. For example, the second calibration parameter includes a second internal parameter and a second distortion parameter. The processor 130 sets the second internal parameter based on a resolution of the third image and then calculates the second distortion parameter based on the second internal parameter. Thereafter, the undistorting operation may be performed based on the second distortion parameter to obtain a second undistorted image, and then the second homography matrix may be calculated according to the second undistorted image and a coordinate matrix corresponding to the calibration panel pattern.

Then, in step S330, the processor 130 performs a compensating operation for an original image to be outputted from the projector 120 based on the second calibration parameter, the second homography matrix and the first homography matrix to obtain a compensated image, so as to output the compensated image on the projection screen 140 from the projector 120.

Steps regarding to the image analysis process in step S310 and step S325 will be further described with reference to the example provided below. FIG. 4 is a flowchart of an image analysis method according to the invention. In the present embodiment, the image (the first image or the third image) to which the processor 130 intends to perform the analysis is referred to as an image under test. The processor 130 is used to calculate an internal parameter K, a distortion parameter k and a homography matrix of the image under test.

First of all, in step S405, the processor 130 receives an image under test. Here, the image under test may be the first image or the third image as described above. Next, in step S410, the processor 130 obtains the internal parameter K based on a resolution of the image under test. In the present embodiment, the internal parameter K is a hypothetical internal parameter, used as a unit area in a mapping operation when correcting the distortions rather than an actual internal parameter of the image capturing apparatus 110. For example, the processor 130 first obtains the internal parameter K based on Equation (1) below. In Equation (1), w and h represent width and height of the image under test, respectively. That is, w and h are a resolution of the image shot by the image capturing apparatus 110.

$\begin{matrix} {K = \begin{bmatrix} w & 0 & {w/2} \\ 0 & h & {h/2} \\ 0 & 0 & 1 \end{bmatrix}} & {{Equation}\mspace{14mu}(1)} \end{matrix}$

Then, in step S415, the processor 130 uses a features detecting method to find a plurality of feature points X_(p) in the image under test. In the case of the grid pattern, corner points of the black and white squares within the grids are so-called the feature points.

Then, in step S420, a coordinate system of the feature points X_(p) and a coordinate system of non-distorted reference points are transformed into a distortion coordinate X_(d) and a non-distortion coordinate X_(s) in unit coordinate according to the internal parameter K. As shown by Equation (2) below, after multiplying each of the feature points X_(p) by K⁻¹ each of the feature points X_(p) is then mapped to a designated range (e.g., a range from −1 to +1) to obtain the distortion coordinate X_(d) regulated under distortion condition.

$\begin{matrix} {X_{d} = {\begin{bmatrix} x_{d} \\ y_{d} \end{bmatrix} = {K^{- 1}X_{p}}}} & {{Equation}\mspace{14mu}(2)} \end{matrix}$

Further, assuming that the grid pattern of the image under test has 8×13 feature points and one non-distortion reference pattern (having 8×13 reference points) is set based on the original grid pattern, the non-distortion coordinate X_(s) refers to the non-distortion feature points in the reference pattern and is also a regulated coordinate (within a numerical range from −1 to +1).

Next, in step S425, the distortion parameter k is determined according to the distortion coordinate X_(d) and the non-distortion coordinate X_(s). After obtaining a correspondence relation between the distortion coordinate X_(d) and the non-distortion coordinate X_(s) in unit coordinate, the two coordinates must satisfy Equation (3).

$\begin{matrix} \begin{matrix} {X_{d} = \begin{bmatrix} x_{d} \\ y_{d} \end{bmatrix}} \\ {= {{\left( {1 + {k_{0}r^{2}} + {k_{1}r^{4}} + {k_{4}r^{6}}} \right)\begin{bmatrix} x_{s} \\ y_{s} \end{bmatrix}} + \begin{bmatrix} {{2k_{2}x_{s}y_{s}} + {k_{3}\left( {r^{2} + {2x_{s}^{2}}} \right)}} \\ {{k_{2}\left( {r^{2} + {2y_{s}^{2}}} \right)} + {2k_{3}x_{s}y_{s}}} \end{bmatrix}}} \end{matrix} & {{Equation}\mspace{14mu}(3)} \end{matrix}$

In Equation (3), r²=x_(s) ²+y_(s) ², and X_(s)=[x_(s), y_(s)]^(T) is a linear non-distortion coordinate. The processor 130 uses Equation (3) to determine the distortion parameter k of the image under test. Generally, a high power polynomial may be adopted to describe the distortion parameter k. For example, the distortion parameter k includes 5 coefficients, k=[k₀, k₁, k₂, k₃, k₄], in the present embodiment. However, the number of coefficients included by the distortion parameter k may be modified based on demands in other embodiments. In order to solve the distortion parameter k, Equation (3) may be rewritten into Equation (4) below. After collecting at least four corresponding points, the distortion parameter k may be solved by a least square method, or may be calculated by a singular value decomposition (SVD).

$\begin{matrix} {\begin{bmatrix} {x_{s}r^{2}} & {x_{s}r^{4}} & {2x_{s}y_{s}} & {r^{2} + {2x_{s}^{2}}} & {x_{s}r^{6}} \\ {y_{s}r^{2}} & {y_{s}r^{4}} & {r^{2} + {2y_{s}^{2}}} & {2x_{s}y_{s}} & {y_{s}r^{6}} \end{bmatrix}{\quad{\begin{bmatrix} k_{0} \\ k_{1} \\ k_{2} \\ k_{3} \\ k_{4} \end{bmatrix} = \begin{bmatrix} {x_{d} - x_{s}} \\ {y_{d} - y_{s}} \end{bmatrix}}}} & {{Equation}\mspace{14mu}(4)} \end{matrix}$

The unitized distortion coordinate X_(d) must be multiplied by the internal parameter K, e.g., Equation (5) to be transformed into the feature points X_(p) in real use. Similarly, the linear non-distortion coordinate X_(s) may also be transformed into a real coordinate system (in pixels) by the internal parameter K. In the mode for processing the distortion, it is preferred to perform operations in the unitized coordinate system in the present embodiment, so an approximation operation for the distortions may be performed in the state of satisfying approximate symmetry and approximate unit circle. The real coordinate system and the unitized coordinate system may be obtained by using the internal parameter or an inverse matrix operation thereof.

$\begin{matrix} {X_{p} = {{KX}_{d} = {K\begin{bmatrix} x_{d} \\ y_{d} \\ 1 \end{bmatrix}}}} & {{Equation}\mspace{14mu}(5)} \end{matrix}$

After the distortion parameter k is solved, an estimated value X_(v) is determined by the non-distortion coordinate X_(s) in step S430. For example, X_(d) obtained by substituting the non-distortion coordinate X_(s) into Equation (3) above may be regarded as the estimated value X_(v). This is because the distortion coordinate X_(d) is measurable by, for example, multiplying each of the corner points within the grid pattern by K⁻¹; and yet the estimated value X_(v) is not an actually measured value, and thus the result obtained by substituting the non-distortion coordinate X_(s) into Equation (3) is additionally defined as the estimated value X_(v).

Then, in step S435, a difference between the estimated value X_(v) and the distortion coordinate X_(d) is evaluated, and a transformation matrix H_(T) between the two is calculated. In step S440, whether to terminate an iterative process is determined. If no, the method proceeds to step S445; if yes, the method proceeds to step S450. For example, if the difference between the estimated value X_(v) and the distortion coordinate X_(d) is higher than a set value, the iterative process is continuously performed. That is to say, in step S445, the transformation matrix H_(T) between the estimated value X_(v) and the distortion coordinate X_(d) is used to update the distortion coordinate X_(d), the non-distortion coordinate X_(s) and the internal parameter K, as shown below. For example, X_(s)=H_(T)X_(s); X_(d)=H_(T) ⁻¹X_(d); K=H_(T)K. Here, aforesaid transformation matrix H_(T) is also a homography matrix.

After the distortion coordinate X_(d), the non-distortion coordinate X_(s) and the internal parameter K are updated, step S425 is re-performed to obtain the distortion parameter k by using Equation (4), then the difference between the estimated value X_(v) and the distortion coordinate X_(d) is re-evaluated, and the iterative process is performed repeatedly in this way. The iterative process may be terminated to obtain the final internal parameter K and the final distortion parameter k when a deviation between the estimated value X_(v) and distortion coordinate X_(d) underwent the iterations is lower than a limited value or when the number of the iterations is higher than a specific value.

After it is determined to terminate the iterative process, in step S450, the homography matrix (the first homography matrix H_(c) or the second homography matrix H_(p)) may be obtained by transforming the non-distortion coordinate X_(s) into a coordinate space of the image capturing apparatus 110 according to the internal parameter K. That is to say, the first homography matrix regarding the coordinate space of the image capturing apparatus 110 and the physical calibration panel is calculated, or the second homography matrix H_(p) regarding the coordinate space of the image capturing apparatus 110 and a coordinate space of the calibration panel pattern inputted to the projector 120 is calculated.

For example, the homography matrix (the first homography matrix H_(c) or the second homography matrix H_(p)) may be obtained by multiplying the non-distortion coordinate X_(s) by the internal parameter K to be transformed into the coordinate space of the image capturing apparatus 110, and calculating the keystone effect by using KX_(s) and the coordinate of the calibration panel. Here, KX_(s) are feature points in an ideal undistorted image. If the internal parameter K may be calculated accurately, KX_(s) will be very close to the feature points in the actual undistorted image.

Example is provided below to describe the mathematical model of the keystone effect. For example, an operation expression of the homography correction for four or more points may be represented by Equation (A) below. X_(i)′=HX_(i)   Equation (A)

A homography matrix H (the first homography matrix H_(c) or the second homography matrix H_(p)) is, for example, a 3×3 matrix. Here, the homography matrix is used to describe a plane coordinate (the first undistorted image underwent the undistorting operation) shot by the image capturing apparatus 110, or may be regarded as a plane coordinate (the second undistorted image underwent the undistort g operation) projected by the projector 120. In order to solve the homography matrix H, it is assumed that, after mapping to a known coordinate space (HX_(i)), the feature points of the coordinate space of the image capturing apparatus 110 has a cross product with respect to the feature points X′_(i) on the known coordinate space being zero vector, as shown in Equation (B). Also, a homogeneous coordinate value of the feature points X_(i)′ of the known coordinate space is shown by Equation (C) X _(i) ′×HX _(i)=0  Equation (B) X_(i)′=[x_(i)′, y_(i)′, w_(i)′]^(T)  Equation (C)

Further, column vectors of the homography matrix H are represented by h^(1T), h^(2T) and h^(3T), respectively, as shown in Equation (D).

$\begin{matrix} {H = \begin{bmatrix} h^{1T} \\ h^{2T} \\ h^{3T} \end{bmatrix}} & {{Equation}\mspace{14mu}(D)} \end{matrix}$

Equation (B) may be re-written and simplified into Equation (E), and by which the homography matrix H may be solved by using the singular value decomposition (SVD).

$\begin{matrix} {{\begin{bmatrix} 0^{T} & {{- w_{i}^{\prime}}X_{i}^{T}} & {y_{i}^{\prime}X_{i}^{T}} \\ {w_{i}^{\prime}X_{i}^{T}} & 0^{T} & {{- x_{i}^{\prime}}X_{i}^{T}} \end{bmatrix}\begin{pmatrix} h^{1} \\ h^{2} \\ h^{3} \end{pmatrix}} = 0} & {{Equation}\mspace{14mu}(E)} \end{matrix}$

The calculated homography matrix H is equivalent to one regression matrix. Therefore, according to the homography matrix, by multiplying any one point X_(i) on the coordinate system shot by the image capturing apparatus 110 by the homography matrix H, a corresponding coordinate value X_(i)′ of the known coordinate system may be calculated.

After the first image is obtained, the processor 130 may obtain the first internal parameter K_(c), the first distortion parameter k_(c) and the first homography matrix H_(c) from the first image by using aforesaid steps S405 to S450. Then, after the second image is obtained, the processor 130 performs the undistorting operation for the second image by using the first internal parameter K_(c) and the first distortion parameter k_(c), so as to eliminate the distortion caused by the image capturing apparatus 110 in the second image to thereby obtain the third image. Then, the processor 130 obtains the second internal parameter K_(p), the second distortion parameter k_(p) and the second homography matrix H_(p) from the third image by using aforesaid steps S405 to S450 again.

After obtaining each of the parameters, the processor 130 can then perform the compensating operation for the original image to be outputted from the projector 120 in order to obtain the compensated image. Here, it is assumed that the original image to be outputted from the projector 120 is I.

First, an inverse homography transformation operation is performed for the original image I by using the second homography matrix H_(p) to obtain a first corrected image H_(p) ⁻¹I. Then, the undistorting operation for the first corrected image H_(p) ⁻¹I by using the second calibration parameter (the second internal parameter K_(p) and the second distortion parameter k_(p)) to obtain the second corrected image undist(H_(p) ⁻¹I). A homography transformation operation is performed for the second corrected image undist(H_(p) ⁻¹I) by using the second homography matrix H_(p) to obtain a third corrected image I′. That is, I′=H_(p)(undist(H_(p) ⁻¹I)).

The distortion of the original image I may be compensated according to aforementioned actions. Lastly, if the keystone effect is to be corrected at the same time, the keystone effect may be corrected simply by using the first homography matrix H_(c)e. That is, the homography transformation operation is performed for the third corrected image I′ by using the first homography matrix H_(c) to obtain a fourth corrected image I″, and the fourth corrected image I″ is used as the compensated image. More specifically, the first homography matrix H_(c) may be further decomposed into a projection transformation matrix, an affine transformation matrix and a similarity transformation matrix H_(s). That is, H_(c)=H_(s)H_(ap). Among them, H_(ap) includes a combination of operations for affine, projection and transition. In other words, H_(ap) is capable of eliminating projection effects of the third corrected image I′, that is, a projection distortion may be generated according to a position of its own shape center so the similarity transformation matrix H_(s) may be used to correct a difference between the third corrected image I′ and the physical calibration panel. Accordingly, by combining the operations for correcting the keystone effect and the distortion, the compensated fourth corrected image is I″=H_(p)H_(ap) ⁻¹(undist(H_(p) ⁻¹I)). Alternatively, the compensated fourth corrected image may also be known as I″=H_(p)H_(ap) ⁻¹H_(p) ⁻¹I′ after transforming the third image.

For example, in the case of a perfect circle, after the compensating operation, the compensated image is an image already being distorted. As such, when the compensated image is outputted from the projector 120, the output circle can maintain at a projection state of the perfect circle.

In summary, in the foregoing embodiments, two images are shot on the projection screen of the projector, one of the images is obtained by shooting the physical calibration panel, and the other image is obtained by shooting the calibration panel pattern projected from the projector. The linear deformation mode and the non-linear deformation mode in the projector may be calculated according to the two images and then further inversely correct an original image expected to be projected based on the linear deformation mode and the non-linear deformation mode so a projected picture can maintain the same proportion as the original image expected to be projected. This technique is capable of significantly simplifying the required hardware design.

It is known that the projector may also be used in the 3D scanner and 3D printer in addition to normal displaying usages, and the thus the corrected projector is also capable of significantly improving the application in precise 3D scanning and precise 3D printing. Because the 3D scanner and 3D printer do adopt various projectors at the present stage and pursuit for improved accuracy of the projection, the foregoing embodiments may be used to effectively solve the linear and non-linear deformation generated during assembly, so as to further provide the improved accuracy of the projection as key technique adopting most of the global wide 3D application projectors at the present stage.

It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents. 

What is claimed is:
 1. An image correction method of projector, comprising: shooting a physical calibration panel by an image capturing apparatus to obtain a first image, wherein the physical calibration panel is arranged on a location where a projection screen of a projector is located; analyzing the first image by using a processor to obtain a first calibration parameter and a first homography matrix of the image capturing apparatus, wherein the first calibration parameter comprises a first internal parameter and a first distortion parameter, the first internal parameter is set based on a resolution of the first image, wherein a width and a height of the first image are the resolution of the first image; shooting an outputting image of a calibration panel pattern on the projection screen outputted from the projector by the image capturing apparatus to obtain a second image; performing an undistorting operation for the second image based on the first internal parameter and the first distortion parameter by using the processor to obtain a third image; analyzing the third image by using the processor to obtain a second calibration parameter and a second homography matrix of the projector, wherein the second calibration parameter comprises a second internal parameter and a second distortion parameter, the second internal parameter is set based on a resolution of the third image, wherein a width and a height of the third image are the resolution of the third image; and performing a compensating operation for an original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix by the processor to obtain a compensated image, so as to output the compensated image on the projection screen from the projector, wherein the first image and the third image are respectively taken as an image under test, and an internal parameter K and a distortion parameter k of the image under test are calculated, the internal parameter K is the first internal parameter or the second internal parameter, and the distortion parameter k is the first distortion parameter or the second distortion parameter, and step of calculating the internal parameter K and the distortion parameter k of the image under test comprising: obtaining the internal parameter K based on a width w and a height h of the image under test, wherein ${K = \begin{bmatrix} w & 0 & {w/2} \\ 0 & h & {h/2} \\ 0 & 0 & 1 \end{bmatrix}};$ finding a plurality of feature points X_(p) in the image under test; multiplying each of the feature points X_(p) by K⁻¹ to obtain a distortion coordinate X_(d); setting a non-distortion reference pattern, wherein a non-distortion coordinate X_(s) refers to non-distortion feature points in the reference pattern; determining the distortion parameter k according to the distortion coordinate X_(d) and the non-distortion coordinate X_(s), wherein the distortion coordinate X_(d) and the non-distortion coordinate X_(s) satisfy following Equation: $\begin{matrix} \begin{matrix} {X_{d} = \begin{bmatrix} x_{d} \\ y_{d} \end{bmatrix}} \\ {{= {{\left( {1 + {k_{0}r^{2}} + {k_{1}r^{4}} + {k_{4}r^{6}}} \right)\begin{bmatrix} x_{s} \\ y_{s} \end{bmatrix}} + \begin{bmatrix} {{2k_{2}x_{s}y_{s}} + {k_{3}\left( {r^{2} + {2x_{s}^{2}}} \right)}} \\ {{k_{2}\left( {r^{2} + {2y_{s}^{2}}} \right)} + {2k_{3}x_{s}y_{s}}} \end{bmatrix}}},} \end{matrix} & \; \\ {and} & \; \\ {{r^{2} = {x_{s}^{2} + y_{s}^{2}}},{X_{s} = \left\lbrack {x_{s},y_{s}} \right\rbrack^{T}},{{k = \left\lbrack {k_{0},k_{1},k_{2},k_{3},k_{4},} \right\rbrack};}} & \; \end{matrix}$ wherein step of performing the undistorting operation for the second image based on the first calibration parameter by using the processor comprise: performing the undistorting operation for the second image based on the first internal parameter and the first distortion parameter to eliminate the distortion caused by the image capturing apparatus in the second image to thereby obtain the third image.
 2. The image correction method of projector according to claim 1, wherein the step of analyzing the first image by using the processor to obtain the first calibration parameter and the first homography matrix of the image capturing apparatus comprises: performing the undistorting operation based on the first distortion parameter to obtain a first undistorted image; and calculating the first homography matrix according to the first undistorted image and a coordinate matrix corresponding to the physical calibration panel.
 3. The image correction method of projector according to claim 1, wherein the step of analyzing the third image by using the processor to obtain the second calibration parameter and the second homography matrix of the projector comprises: performing the undistorting operation based on the second distortion parameter to obtain a second undistorted image; and calculating the second homography matrix according to the second undistorted image and a coordinate matrix corresponding to the calibration panel pattern.
 4. The image correction method of projector according to claim 1, wherein the step of performing the compensating operation for the original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix by the processor to obtain the compensated image comprises: performing an inverse homography transformation operation for the original image by using the second homography matrix to obtain a first corrected image; performing the undistorting operation for the first corrected image by using the second internal parameter and the second distortion parameter to obtain a second corrected image; performing a homography transformation operation for the second corrected image by using the second homography matrix to obtain a third corrected image; and performing the homography transformation operation for the third corrected image by using the first homography matrix to obtain a fourth corrected image, which is the compensated image.
 5. The image correction method of projector according to claim 1, wherein the image capturing apparatus and the projector are located on the same side of the projection screen, or the image capturing apparatus and the projector are located on different sides of the projection screen.
 6. An image correction system, comprising: a projector; an image capturing apparatus, shooting a physical calibration panel arranged on a location where a projection screen of a projector is located to obtain a first image, and shooting an outputting image of a calibration panel pattern on the projection screen outputted from the projector to obtain a second image; and a processor, coupled to the image capturing apparatus and the projector; wherein the processor analyzes the first image to obtain a first calibration parameter and a first homography matrix of the image capturing apparatus, wherein the first calibration parameter comprises a first internal parameter and a first distortion parameter, the first internal parameter is set based on a resolution of the first image, wherein a width and a height of the first image are the resolution of the first image; the processor performs an undistorting operation for the second image based on the first internal parameter and the first distortion parameter to obtain a third image; the processor analyzes the third image to obtain a second calibration parameter and a second homography matrix of the projector, wherein the second calibration parameter comprises a second internal parameter and a second distortion parameter, the second internal parameter is set based on a resolution of the third image, wherein a width and a height of the third image are the resolution of the third image; the processor performs a compensating operation for an original image to be outputted from the projector based on the second calibration parameter, the second homography matrix and the first homography matrix to obtain a compensated image, so as to output the compensated image on the projection screen from the projector, wherein the processor takes the first image and the third image respectively taken as an image under test, and calculates an internal parameter K and a distortion parameter k of the image under test, wherein the internal parameter K is the first internal parameter or the second internal parameter, and the distortion parameter k is the first distortion parameter or the second distortion parameter, and step of calculating the internal parameter K and the distortion parameter k of the image under test comprises: obtaining the internal parameter K based on a width w and a height h of the image under test, wherein ${K = \begin{bmatrix} w & 0 & {w/2} \\ 0 & h & {h/2} \\ 0 & 0 & 1 \end{bmatrix}};$ finding a plurality of feature points X_(p) in the image under test; multiplying each of the feature points X_(p) by K⁻¹ to obtain a distortion coordinate X_(d); setting a non-distortion reference pattern, wherein a non-distortion coordinate X_(s) refers to non-distortion feature points in the reference pattern; determining the distortion parameter k according to the distortion coordinate X_(d) and the non-distortion coordinate X_(s), wherein the distortion coordinate X_(d) and the non-distortion coordinate X_(s) satisfy following Equation: $\begin{matrix} \begin{matrix} {X_{d} = \begin{bmatrix} x_{d} \\ y_{d} \end{bmatrix}} \\ {{= {{\left( {1 + {k_{0}r^{2}} + {k_{1}r^{4}} + {k_{4}r^{6}}} \right)\begin{bmatrix} x_{s} \\ y_{s} \end{bmatrix}} + \begin{bmatrix} {{2k_{2}x_{s}y_{s}} + {k_{3}\left( {r^{2} + {2x_{s}^{2}}} \right)}} \\ {{k_{2}\left( {r^{2} + {2y_{s}^{2}}} \right)} + {2k_{3}x_{s}y_{s}}} \end{bmatrix}}},} \end{matrix} & \; \\ {and} & \; \\ {{r^{2} = {x_{s}^{2} + y_{s}^{2}}},{X_{s} = \left\lbrack {x_{s},y_{s}} \right\rbrack^{T}},{{k = \left\lbrack {k_{0},k_{1},k_{2},k_{3},k_{4},} \right\rbrack};}} & \; \end{matrix}$ wherein the processor performs the undistorting operation for the second image based on the first internal parameter and the first distortion parameter to eliminate the distortion caused by the image capturing apparatus in the second image to thereby obtain the third image.
 7. The image correction system according to claim 6, wherein the processor performs the undistorting operation based on the first distortion parameter to obtain a first undistorted image, and calculates the first homography matrix according to the first undistorted image and a coordinate matrix corresponding to the physical calibration panel.
 8. The image correction system according to claim 6, wherein the processor performs the undistorting operation based on the second distortion parameter to obtain a second undistorted image, and calculates the second homography matrix according to the second undistorted image and a coordinate matrix corresponding to the calibration panel pattern.
 9. The image correction system according to claim 6, wherein the processor performs an inverse homography transformation operation for the original image by using the second homography matrix to obtain a first corrected image, performs the undistorting operation for the first corrected image by using the second internal parameter and the second distortion parameter to obtain a second corrected image, performs a homography transformation operation for the second corrected image by using the second homography matrix to obtain a third corrected image, and performs the homography transformation operation for the third corrected image by using the first homography matrix to obtain a fourth corrected image, which is the compensated image.
 10. The image correction system according to claim 6, wherein the image capturing apparatus and the projector are located on the same side of the projection screen, or the image capturing apparatus and the projector are located on different sides of the projection screen. 